<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="scripts/jquery/jquery-1.7.1.js"></script>
<link href="style/authority/basic_layout.css" rel="stylesheet" type="text/css">
<link href="style/authority/common_style.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="scripts/authority/commonAll.js"></script>
<script type="text/javascript" src="scripts/fancybox/jquery.fancybox-1.3.4.js"></script>
<script type="text/javascript" src="scripts/fancybox/jquery.fancybox-1.3.4.pack.js"></script>
<link rel="stylesheet" type="text/css" href="style/authority/jquery.fancybox-1.3.4.css" media="screen"></link>
<script type="text/javascript" src="scripts/artDialog/artDialog.js?skin=default"></script>
<title>商品一级分类管理</title>
<style>
	.alt td{ background:black !important;}
</style>
	<script type="text/javascript">

		function processInsert()
		{
			document.form1.action="servlet/Categorylv1servlet?type=insert&name="+document.getElementById("categorylv1name").value;
			document.form1.submit();
		}
		function processDelete(name)
		{
			document.form1.action="servlet/Categorylv1servlet?type=delete&name="+name;
			document.form1.submit();
		}
	</script>
</head>
<body>
	<form name="form1" method="post">
		<div id="container">	
		<div class="ui_content">
				<div class="ui_text_indent">
					<div id="box_border">
						<div id="box_top">搜索</div>
						<div id="box_center" >
							商品一级分类名&nbsp;&nbsp;<input class="ui_input_txt02" id="categorylv1name" name="categorylv1" type="text"/>
						</div>
						<div id="box_bottom">
							<input class="ui_input_btn01" onclick="processInsert()" value="插入" type="button"/>
						</div>
					</div>
				</div>
			</div>		
			<div class="ui_content">
				<div class="ui_tb">
					<table width="100%" class="table" id="showtable" name="showtable">
				    	<tr >
				    		<th>商品一级分类</th>
				    		<th>操作</th>
				    	</tr>				    
				    	<c:forEach items="${categorylv1}" var="temp">
				    		<tr><td>${temp}</td><td><button class="ui_input_btn01" onclick="processDelete('${temp }')" >删除</button></td></tr>
				    	</c:forEach>
				    </table>
				</div>
			</div>
		</div>
	</form>
</body>
</html>
